package com.lanju.entity;

import java.math.BigDecimal;

import com.dxl.common.utils.Utils;
import com.dxl.entity.common.BaseEntity;

/**
 * 商品
 * @author fei
 *
 */
public class ProductSku extends BaseEntity{
	
	private static final long serialVersionUID = 3705305210019020308L;

	private String cateId;
	
	private String prodId;
	
	private String path; // 图片地址
	
	private String unit;	//单位
	
	private String bigUnit;	//大单位
	
	private Integer unitTimes; // 单位倍数
	
	private String viewUnit;	//显示单位json,格式   [{"unit":"箱","decimal":10}], unit表示显示， decimal表示跟对应unit的比例
	
	private String color;	//颜色
	
	private String taste;	//味道
	
	private BigDecimal unitPrice; // 单价

	public String getCateId() {
		return cateId;
	}

	public void setCateId(String cateId) {
		this.cateId = cateId;
	}

	public String getProdId() {
		return prodId;
	}

	public void setProdId(String prodId) {
		this.prodId = prodId;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getTaste() {
		return taste;
	}

	public void setTaste(String taste) {
		this.taste = taste;
	}

	public BigDecimal getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}	
	
	public String getViewUnit() {
		return viewUnit;
	}

	public void setViewUnit(String viewUnit) {
		this.viewUnit = viewUnit;
	}

	public String getBigUnit() {
		return bigUnit;
	}

	public void setBigUnit(String bigUnit) {
		this.bigUnit = bigUnit;
	}

	public Integer getUnitTimes() {
		return unitTimes;
	}

	public void setUnitTimes(Integer unitTimes) {
		this.unitTimes = unitTimes;
	}

	public String toSkuName() {
		String skuName = "";
		if (Utils.isNotBlank(this.getColor())) {
			skuName += this.getColor();
		}
		if (Utils.isNotBlank(this.getTaste())) {
			if (Utils.isNotBlank(skuName)) {
				skuName += "-";
			}
			skuName += this.getTaste();
		}
		return skuName;
	}
}
